import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routers = [
    {
        path: '/',
        name: 'Hello',
        component:()=>import("../components/HelloWorld.vue"),
        meta:{
            title: "米豆云"
        }
    },
    {
        path: '/register',
        name: 'Register',
        component:()=>import("../components/register/Register.vue"),
        meta:{
            title: "注册信息"
        }
    },
    {
        path: '/login',
        name: 'Login',
        component:()=>import("../components/login/Login.vue"),
        meta:{
            title: "米豆云登录"
        }
    },
    {
        path: '/register',
        name: 'Register',
        component:()=>import("../components/register/Register.vue"),
        meta:{
            title: "米豆云注册"
        }
    },
    {
       path: '/index',
        name: 'Index',
        component:()=>import("../components/home_page/index.vue"),
        children:[
            {
                path: 'dishesManagement',
                name: 'DishesManagement',
                component:()=>import("../components/DishesManagement/DishesManagement.vue"),
                meta:{
                    title: "菜品管理"
                }
            },
            {
                path: '/',
                name: 'Chart',
                component:()=>import("../components/Echarts/chart.vue"),
                meta:{
                    title: "米豆云"
                }
            }
            ,
            {
                path: 'shop',
                name: 'Shop',
                component:()=>import("../components/shop/shop.vue"),
                meta: {
                    title: "店铺信息"
                }
            },
            {
                path: 'staff',
                name: 'Staff',
                component:()=>import("../components/restaurant/Staff.vue"),
                meta:{
                    title: "员工管理"
                }
            },
            {
                path: 'order',
                name: 'Order',
                component:()=>import("../components/order/Order.vue"),
                meta:{
                    title: "网络订单"
                }
            },
            {
                path: 'work-info',
                name: 'WorkInfo',
                component:()=> import("../components/worker_info/woker_info.vue")
            },
            {
                path: 'vip',
                name: 'vip',
                component:()=>import("../components/vip/vip.vue"),
                meta:{
                    title: "会员管理"
                }
            },
            {
                path: 'kucun',
                name: 'KuCun',
                component:()=>import("../components/kucun/KuCun.vue"),
                meta:{
                    title: "库存管理"
                }
            },
            {
                path: 'comment',
                name: 'comment',
                component:()=>import("../components/gukedianping/Comment"),
                meta:{
                    title: "评论管理"
                }

            },


            {
                path: 'coupon',
                name: 'Coupon',
                component:()=>import("../components/restaurant/Coupon.vue"),
                meta:{
                    title: "优惠券"
                }
            },
            {
                path: 'work-dianjibianji',
                name: 'WorkDianjibianji.vue',
                component:()=>import("../components/worker_info/workDianjibianji.vue"),
                meta:{
                    title: "优惠券"
                }
            },
            {
                path: 'desk',
                name: 'Desk',
                component:()=>import("../components/restaurant/Desk.vue"),
                meta:{
                    title: "桌台"
                }
            },
            {
                path: 'deskfication',
                name: 'Desk',
                component:()=>import("../components/restaurant/DeskFication.vue"),
                meta:{
                    title: "桌台类别"
                }
            },
            {
                path: 'coupon',
                name: 'DishesManagement',
                component:()=>import("../components/restaurant/Coupon.vue"),
                meta:{
                    title: "会员管理"
                }
            },{
                path: "/set-meal",
                name: "setMeal",
                component: ()=>import("../components/DishesManagement/SetMeal.vue"),
                meta: {
                    title: "员工列表"
                }
            },
            {
                path: "/service-message",
                name: "ServiceMessage",
                component: ()=>import("../components/service/ServiceMessage.vue"),
                meta: {
                    title: "服务消息"
                }
            },{
                path: "appointment",
                name: "appointment",
                component: ()=>import("../components/restaurant/Appointment.vue"),
                meta: {
                    title: "预约"
                }
            },
        ],
        meta:{
            title: "操作"
        }
    },
]
//创建 router 实例，然后传 routes 配置
const router=new VueRouter({
    routes: routers
});

export default router
